{extend name="layout/main-block" /}

<!-- main content start -->
{block name="content"}
<section id="main-content">
    <section class="wrapper">
        <div class="row">
            <ol class="breadcrumb">
                <li class="h4"><a href="">部门管理</a></li>
            </ol>
        </div>
        <div class="row col-sm-1" style="margin-bottom: 20px;">
            <a href="{:url('department/department_create')}" class="btn btn-primary" role="button">添加部门</a>
        </div>
        <div class="row content-main">
            <div class="col-sm-12">
                <form action="">
                    <table class="table table-striped">
                        <tr>
                            <th>id</th>
                            <th>部门名称中文</th>
                            <th>部门名称英文</th>
                            <th>操作</th>
                        </tr>
                        {volist name="department" id="v" empty="$empty" }
                        <tr>
                            <td>{$v.department_id}</td>
                            <td>{$v.department_name_cn |mb_substr=0,8}</td>
                            <td>{$v.department_name_en |mb_substr=0,10}</td>
                            <td class="operation">
                                <a class="btn btn-info btn-xs" href="{:url('department/department_update', ['id'=>$v.department_id])}"><i class="glyphicon glyphicon-edit"></i>修改</a>
                               <!-- <a class="btn" href="{:url('department/department_enable', ['id'=>$v.department_id])}" value="">启用</a>-->
                                <a class="btn btn-danger btn-xs" href="{:url('department/department_delete', ['id'=>$v.department_id])}" onclick="return confirm('确定要删除吗？');"><i class="glyphicon glyphicon-remove"></i>删除</a>
                            </td>
                        </tr>
                        {/volist}
                    </table>
                </form>
            </div>
        </div>
{$page}
    </section>
</section>
{/block}

{block name="javascript"}
<script type="text/javascript">
   /* $(function(){
        $oBtn = $(".btn");

        $oBtn.click(function(){
            if($oBtn.is("")){
                $oBtn.val("启用");
            }else{
                $oBtn.val("禁用");
            }
        })
    })*/
</script>
{/block}